package com.company.test32;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Created by v on 16-12-8.
 */
public class Test32_03 {
    CourseWithActionEvent course=new
            CourseWithActionEvent("Java Programming");

    public Test32_03(){
        course.setEnrollmentCap(2);
        ActionListener listener=new Listener();
        course.addActionListener(listener);
        course.addStudent("FV");
        course.addStudent("SK");
        course.addStudent("ES");
    }

    public static void main(String[] args) {
        new Test32_03();
    }

    private class Listener implements ActionListener{
        @Override
        public void actionPerformed(ActionEvent e) {
            System.out.println("Enrollment cap exceeded");
        }
    }
}
